﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RuleCode.WebControls;
using System.IO;
using System.Xml;
using RuleCode.ObjectTree;

namespace ERPTemplate.Public
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {                     
            FileInfo fInfo =new  FileInfo ("D:\\aa.txt");
            fInfo.Attributes = FileAttributes.ReadOnly | FileAttributes.Hidden;
            if (!IsPostBack)
            {
                Initdd();
            }
        }

        private void Initdd()
        {
             

            ListBox_AllQuery.Items.Clear();
            string tablename = "User";
            string id = "ddd";
            string queryXmlFilePath = RuleQueryTable.getXMLFileName(tablename, id);
            if(Directory .Exists (queryXmlFilePath )  )
            {                                 
                DirectoryInfo dInfo =new DirectoryInfo (queryXmlFilePath );
                FileInfo[] allXmlQueryFiles = dInfo.GetFiles("*.xml");
                foreach (FileInfo fInfo in allXmlQueryFiles)
                {
                    ListBox_AllQuery.Items.Add(fInfo.Name.ToLower ().TrimEnd (".xml".ToCharArray ()));
                }
            }
        }

        
    }
}
